package com.ioc.demo.controller;

import com.ioc.demo.model.DbTypes;
import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.lang.reflect.Type;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 王圆豪
 * Date: 2025-07-05
 * Time: 10:50
 */
@Component
public class YmlController {
    @Value("${my.key3}")
    private Integer myKey3;
    @Value("${my.key4}")
    private Integer myKey4;

    @Autowired
    private DbTypes dbTypes;

    @PostConstruct
    public void read(){
        System.out.println("myKey3:" + myKey3);
        System.out.println("myKey4:" + myKey4);
        System.out.println("dbtypes:" + dbTypes.getName().toString());
        System.out.println("map:" + dbTypes.getMap().toString());
    }
}
